import random

from aiogram import Router
from aiogram.types import Message
from aiogram.filters import Command, CommandObject, CommandStart

from keyboards import reply

from filters.is_admin import IsAdmin
from filters.is_digit_or_float import CheckForDigit

router = Router()

@router.message(CommandStart(), IsAdmin(""))
async def staer(message: Message):
    await message.answer("Hello, AIogram 3.x!", reply_markup=reply.main)


@router.message(Command("pay"), CheckForDigit()) # /pay 1234
async def pay_the_order(message: Message, command: CommandObject) -> None:
    await message.answer("Вы успешно оплатили товар!")



@router.message(Command(commands=["rn", "rand-number"])) # /rn 1-100
async def get_random_number(message: Message, command: CommandObject):
    a, b = [int(n) from n in command.args.split("-")]
    rnum = random.randint(a, b)
    
    await message.reply(f"random number: {rnum}")